package com.gitee.feizns.quickstart.validation.validator;

import com.gitee.feizns.dynamic.Sets;
import com.gitee.feizns.quickstart.validation.constraints.Words;

import java.lang.reflect.Array;
import java.util.Collection;
import java.util.Set;

/**
 * 验证字符、数组{@link Array}或者集合{@link Collection}中的数据是否都在值{@link Words#value()}序列中
 * @author feizns
 * @since 2023/2/7
 */
public class WordsConstraintValidator extends AbstractAllMatchConstraintValidator<Words, String> {

    @Override
    protected Set<String> initializeValues(Words constraintAnnotation) {
        return Sets.of(constraintAnnotation.value());
    }

}
